<?php 
namespace app\manage\validate;
use think\Validate;

class Menu extends Validate
{
    protected $rule = [
        'name'  =>  'require|max:25|unique:menu',
        'module'  =>  'require|alpha',
        'controller'  =>  'require|alpha',
        'action'  =>  'require|alpha',
        'listorder' => 'number',

    ];

    protected $message  =   [
        'name.require' => '请填写菜单名称！',
        'name.max' => '菜单名称长度不得超过25位！',
        'name.unique' => '菜单名称必须唯一！',

        'module.require' => '请填写所属模块！', 
        'module.alpha' => '所属模块必须是纯字母！',

        'controller.require' => '请填写所属控制器！',
        'controller.alpha' => '所属控制器必须是纯字母！',

        'action.require' => '请填写所属方法！',
        'action.alpha' => '所属方法必须是纯字母！',

        'listorder.number' => '排序内容必须是纯数字！',

    ];

}


 ?>